<?php
//包含连接数据库的公共文件
require_once("./conn.php");


    //获取表单提交数据
    $admin_id=$_POST["admin_id"];
    $username=$_POST["username"];
    $password=$_POST["password"];

    //构建插入SQL语句
    $sql="insert into admin values('$admin_id','$username','$password')";
    echo $sql;
    $set=mysqli_query($con,$sql);
    if($set==1){
        echo "<script>alert('添加成功');location='show_admin.php';</script>";
    }else{
        echo "<script>alert('添加失败管理员ID是唯一');location='add_admin.html';</script>";
    }


?>